package com.bingguo.interceptor;

public class returnBody<T> {

    public static Integer SUCESS = 200;
    public static Integer ERROR = 500;

    private Integer code;
    private Boolean success;
    private String desc;
    private T data;
    private int count;

    public static Integer getSUCESS() {
        return SUCESS;
    }

    public returnBody setSUCESS(Integer SUCESS) {
        returnBody.SUCESS = SUCESS;
        return this;
    }

    public static Integer getERROR() {
        return ERROR;
    }

    public returnBody setERROR(Integer ERROR) {
        returnBody.ERROR = ERROR;
        return this;
    }

    public Integer getCode() {
        return code;
    }

    public returnBody setCode(Integer code) {
        this.code = code;
        return this;
    }

    public Boolean getSuccess() {
        return success;
    }

    public returnBody setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public returnBody setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public Object getData() {
        return data;
    }

    public returnBody setData(T data) {
        this.data = data;
        return this;
    }

    public int getCount() {
        return count;
    }

    public returnBody setCount(int count) {
        this.count = count;
        return this;
    }

    public static returnBody ok(){
        returnBody returnBody = new returnBody();
        returnBody.setCode(SUCESS);
        returnBody.setSuccess(true);
        returnBody.setDesc("成功");
        return returnBody;
    }

    public static returnBody error(){
        returnBody returnBody = new returnBody();
        returnBody.setCode(ERROR);
        returnBody.setDesc("失败");
        returnBody.setSuccess(false);
        return returnBody;
    }

}
